import request from '@/api/utils/request'
import type { CommentPostDTO } from './types/post'

// 阅读消息
export const usePostReadMsgApi = (msgId: number) => {
  return request.post('/post/readMsg', msgId)
}

// 评论帖子
export const usePostCommentApi = (data: CommentPostDTO) => {
  return request.post('/post/commentPost', data)
}

// 获取未读消息
export const usePostGetUnreadMsgApi = () => {
  return request.get('/post/getUnreadMsg')
}

// 获取所有帖子
export const usePostGetAllPostsApi = () => {
  return request.get('/post/getAllPosts')
}

export const usePostGetCommentByPostIdApi = (
  data: CommentPostDTO,
) => {
  return request.post(`/post/getComment`, data)
}
